package springcloud_eureka_ribbon_consumer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * Hello world!
 *
 */
@EnableEurekaClient
@EnableFeignClients
@SpringBootApplication
public class App{
  public static void main(String[] args) {
      SpringApplication.run(App.class, args);
      System.out.println("ribbon消费者负载均衡服务启动...");
  }
  @Bean
  @LoadBalanced  //开启均衡负载能力
  public RestTemplate restTemplate() {
	  return new RestTemplate();
  }
}